<template>
    <div class="progress">
      <div class="progress-wrapper">
        <div class="progress-back">

        </div>
        <div class="progress-bar" :style="{width:width}">

        </div>
      </div>
      <div class="progress-num">
        {{num}}%
      </div>
    </div>
</template>

<script>
  export default {
    name: 'progress',
    props: {
      num: {
        type: Number,
        default: 50
      }
    },
    computed: {
      width () {
        return this.num + '%'
      }
    }
  }
</script>

<style scoped>
  .progress {
    width: 100%;
    position: relative;
    height: 22rpx;
    flex: 1;
    display: flex;
  }

  .progress-wrapper {
    flex: 1;
    height: 12rpx;
    position: relative;
    display: flex;
    align-items: center;
    top: 12rpx;
  }

  .progress-back {
    width: 100%;
    height: 100%;
    background: rgba(230, 242, 255, 1);
    border-radius: 12rpx;
  }

  .progress-num {
    width: 100rpx;
    font-size: 32rpx;
    flex-shrink: 0;
    color: rgba(69, 148, 230, 1);
    text-align: center;
  }

  .progress-bar {
    height: 12rpx;
    position: absolute;
    left: 0;
    top: 0;
    background: rgba(255, 158, 77, 1);
    border-radius: 12rpx;
  }
</style>
